package com.knife.blog.logic;

import java.io.InputStream;
import java.util.Collection;
import java.util.List;

import com.knife.blog.domain.BlogInfo;
import com.knife.blog.domain.Photo;
import com.knife.blog.domain.PhotoDir;
import com.knife.web.tools.IPageList;

public interface PhotoService {
	Photo getPhoto(String cid);

	boolean addPhoto(Photo photo);

	boolean delPhoto(String cid);

	int batchDelPhoto(String[] cids);

	boolean updatePhoto(Photo photo);
	
	List queryPhotoByBlog(BlogInfo blog);

	IPageList queryPhoto(PhotoDir dir, int currentPage, int pageSize);
	
	IPageList queryPhoto(String dir, String username, int currentPage, int pageSize);

	IPageList queryPhoto(String username, int currentPage,
			int pageSize);
	
	IPageList queryPhotoByFieldName(String fieldName,String value,int currentPage,
			int pageSize);
	
	IPageList queryCirclePhoto(String cid,int currentPage,int pageSize);
	
	IPageList queryPhoto(String scope,Collection paras,int currentPage,int pageSize);

	PhotoDir getPhotoDir(String cid);

	boolean addPhotoDir(PhotoDir photoDir);

	boolean delPhotoDir(String cid);

	int batchDelPhotoDir(String[] cids);

	boolean updatePhotoDir(PhotoDir photoDir);

	IPageList queryPhotoDir(String username, int currentPage,
			int pageSize);
	
	IPageList queryChildPhotoDir(String parentsn, int currentPage, int pageSize);

	void uploadPhoto(Photo photo, InputStream in);
	
	Photo readPhoto(String cid);
	
	boolean removePhotoHtml(Photo photo);
}
